package org.example.platerecognize;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.ToString;
import org.example.platerecognize.base.ColorEnum;
import org.example.platerecognize.base.LayoutEnum;

import java.awt.Point;
import java.io.Serializable;
import java.util.List;

/**
 * @author Zhou
 * @date 14:28 2024/7/16
 */
@Data
public class PlateVO implements Serializable {

    /**车牌置信分数**/
    private Float score;
    /**
     * 车牌布局
     */
    private LayoutEnum layout;

    /**车牌位置信息**/
    private PlateLocation location;


    /**车牌识别信息**/
    private PlateInfo2 plateInfo;

    /**
     * 图片
     */
    private String pictureBase64;

    /**
     * 车牌位置信息
     * 四个点位:左上、右上、左下、右下
     */
    public static class PlateLocation {

        /**
         * 点位：
         * 0(L_TOP)   1(R_TOP)
         * 2(L_BOT)   3(R_BOT)
         */
        @Getter
        private final List<Point> points;

        public PlateLocation(List<Point> points) {
            this.points = points;
        }
    }

    @ToString
    @AllArgsConstructor
    @Getter
    public static class PlateInfo2 {
        /**
         * 车牌颜色
         */
        private ColorEnum color;
        /**
         * 车牌号
         */
        private String plateNumber;

    }
}
